package com.isoft.controller.sys;


import com.isoft.bean.ResponseData;
import com.isoft.controller.BaseController;
import com.isoft.entity.PageBean;
import com.isoft.service.impl.SysLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import static dm.jdbc.util.DriverUtil.log;

@CrossOrigin
@RestController
@RequestMapping("/sys/log")
public class SysLogController extends BaseController {

    @Autowired
    SysLogService sysLogService;

    //获取日志记录
    @GetMapping("gets")
    public ResponseData<Object> getsAll(int currentPage, int size) {
        return returnObject(sysLogService.getSysLog(currentPage, size));
    }

    @DeleteMapping("delete/{id}")
    public ResponseData<Boolean> deleteLine(@PathVariable("id") Integer id) {
        return returnBoolean(sysLogService.delLog(id));
    }
    @GetMapping("getsByCons")
    public ResponseData<Object> getsAll(int currentPage, int size,String systype, String oprtype) {
        return returnObject(sysLogService.getByCons(currentPage,size, systype, oprtype));
    }
}
